Skip to content

Conversation

@Arwayday
Copy link
Contributor

@Arwayday Arwayday commented Sep 2, 2025

Add target config for HOWI HWH7 (STM32H743).

Dual SPI ICM-42688P IMUs with external CLKIN; MPU6000 drivers kept for backward compatibility. Barometer on I2C2 (supports BMP280 / MS5611 / DPS310); external magnetometer can share I2C2. MAX7456 OSD on SPI3.
SDMMC (SDIO 4-bit) Blackbox enabled and set as default device. Motors on TIM1/TIM4, servos on TIM15, beeper PWM 3 kHz (inverted), LED strip enabled. Default ports: CRSF, MSP-DisplayPort on USART2, MSP on USART3, GPS on UART4, ESC telemetry on USART8. ADC: VBAT/CURR plus two external channels; defaults set (voltage scale 110, current scale 170, offset −350). Complete timer map and DMA options provided to avoid conflicts; DSHOT bitbang enabled. SWD enabled; PINIO defaults for “CAM 1,2” and “SW_VTX”.

Summary by CodeRabbit

  • New Features
    • Added support for HWH7 flight controller (STM32H743) with DPS310 barometer and dual ICM-42688P gyros (clock-in capable).
    • Defaults RX to CRSF and provides many UARTs for RX, MSP, GPS, and ESC telemetry.
    • Supports up to 8 motors, 2 servos, LED/LED strip, beeper, OSD (MAX7456) and SD card Blackbox logging (4-bit SDIO).
    • ADC-based voltage/current metering with presets, user-configurable PINIO switches, and DShot bitbang enabled.

Add target config for HW XROTOR-H7 (STM32H743).
Dual SPI ICM-42688P IMUs with external CLKIN; MPU6000 drivers kept for backward compatibility.
Barometer on I2C2 (supports BMP280 / MS5611 / DPS310); external magnetometer can share I2C2.
MAX7456 OSD on SPI3.
SDMMC (SDIO 4-bit) Blackbox enabled and set as default device.
Motors on TIM1/TIM4, servos on TIM15, beeper PWM 3 kHz (inverted), LED strip enabled.
Default ports: CRSF on USART1, MSP-DisplayPort on USART2, MSP on USART3, GPS on UART4, ESC telemetry on USART8.
ADC: VBAT/CURR plus two external channels; defaults set (voltage scale 110, current scale 170, offset −350).
Complete timer map and DMA options provided to avoid conflicts; DSHOT bitbang enabled.
SWD enabled; PINIO defaults for “CAM 1,2” and “SW_VTX”.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 2, 2025

Walkthrough

Adds a new HWH7 board configuration header for STM32H743 defining MCU/board IDs, enabled sensors (dual ICM‑42688P gyros, DPS310 baro), pin/instance mappings for SPI/I2C/UART/SDIO/TIM/ADC, motor/servo/LED/beeper pins, DMA/timer options, PINIO boxes, and default serial/MSP/blackbox settings.

Changes

Cohort / File(s) Summary
New board config: HWH7
configs/HWH7/config.h
Introduces complete HWH7 header: sets FC_TARGET_MCU, BOARD_NAME, MANUFACTURER_ID; enables ACC/GYRO/BARO and specific drivers (ICM42688P, DPS310); defines SPI/I2C/UART/SDIO/ADC pins and instances; dual gyro CS/EXTI/ALIGN and gyro CLKIN pins; motor/servo/LED/beeper pins; MAX7456 display; SDCard/blackbox defaults; TIMER_PIN_MAPPING; DMA optimization values; PINIO boxes; default serial/receiver/MSP/GPS/ESC UART assignments.

Sequence Diagram(s)

No sequence diagrams generated — changes are hardware configuration definitions without control-flow modifications.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • add HDZERO_AIO15 #784 — Adds a similar STM32H743 board config with overlapping macros (dual ICM‑42688P, DPS310, TIMER_PIN_MAPPING, SPI/CS/EXTI and UART/SDIO mappings).

Suggested reviewers

  • haslinghuis
  • ot0tot
  • nerdCopter

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The PR description gives a concise technical summary of the new STM32H743 HWH7/XROTOR-H7 target (IMUs, barometer, OSD, SDIO, timers, UART mappings and ADC defaults), but it does not follow the repository's required template: it omits confirmation of Betaflight schematics review and hardware-sample testing, lacks a link to the board schematics, does not replace the housekeeping placeholder or confirm the PR is from a non-master branch, and the required checklist is unfilled. These items are mandatory for new flight-controller submissions. Because those mandatory review/testing and housekeeping details are missing, the description is incomplete. Please update the PR description to follow the repository template: replace the placeholder housekeeping text and confirm the PR branch is not master, fill the checklist with pass/fail (or y/n) for each item, attach a link to the board schematics and state whether the Betaflight schematics review has been performed, and include hardware-sample and flight-test results (or planned test steps) plus confirmation of compliance with the Manufacturer Design Guidelines and connector standards; also verify the ADC/voltage/current scale and offset values in the description match the values in configs/HWH7/config.h.
✅ Passed checks (2 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
Title Check ✅ Passed The title "Add HWH7 (STM32H743) config – initial" is concise, a single sentence, and accurately describes the primary change (adding a new HWH7 STM32H743 board configuration), so it clearly communicates the PR's main intent to reviewers.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
configs/XROTOR-H7/config.h (2)

28-36: Sensor driver set is appropriate for mixed production.

Enabling both ICM42688P and MPU6000 aligns with auto-detect/back-compat strategy. Consider pinning a default with DEFAULT_GYRO_TO_USE to avoid ambiguity if both probe as present.

Apply near the gyro block:

+#define DEFAULT_GYRO_TO_USE          GYRO_1

201-208: Gate MSP DisplayPort UART behind USE_OSD_HD.

MSP_DISPLAYPORT_UART should be active only when building HD OSD. This avoids confusion on analog-only builds.

-#define MSP_DISPLAYPORT_UART SERIAL_PORT_USART2
+#ifdef USE_OSD_HD
+#define MSP_DISPLAYPORT_UART SERIAL_PORT_USART2
+#endif
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between e0af134 and e1014d7.

📒 Files selected for processing (1)
  • configs/XROTOR-H7/config.h (1 hunks)
🧰 Additional context used
🧠 Learnings (15)
📓 Common learnings
Learnt from: haslinghuis
PR: betaflight/config#0
File: :0-0
Timestamp: 2025-07-03T15:17:30.040Z
Learning: In Betaflight configurations, when a target name suggests dual IMUs (like JHEF7DUAL) but specific hardware variants only have one gyro available, the preferred solution is to use DEFAULT_GYRO_TO_USE macro to specify which gyro to use by default rather than pruning gyro defines or creating redundant configurations. This approach maintains compatibility when the same target is used by multiple hardware variants from the same manufacturer.
Learnt from: haslinghuis
PR: betaflight/config#835
File: configs/HDZERO_HALO_MPU6000/config.h:44-56
Timestamp: 2025-07-14T16:16:56.822Z
Learning: For Betaflight board configurations of boards already in production, pin assignments in config.h files reflect the actual hardware design and cannot be changed, even if they present potential conflicts with debug interfaces. The configuration must match the physical board layout, not ideal software design preferences.
📚 Learning: 2025-07-14T16:16:56.822Z
Learnt from: haslinghuis
PR: betaflight/config#835
File: configs/HDZERO_HALO_MPU6000/config.h:44-56
Timestamp: 2025-07-14T16:16:56.822Z
Learning: For Betaflight board configurations of boards already in production, pin assignments in config.h files reflect the actual hardware design and cannot be changed, even if they present potential conflicts with debug interfaces. The configuration must match the physical board layout, not ideal software design preferences.

Applied to files:

  • configs/XROTOR-H7/config.h
📚 Learning: 2025-07-03T15:17:30.040Z
Learnt from: haslinghuis
PR: betaflight/config#0
File: :0-0
Timestamp: 2025-07-03T15:17:30.040Z
Learning: In Betaflight configurations, when a target name suggests dual IMUs (like JHEF7DUAL) but specific hardware variants only have one gyro available, the preferred solution is to use DEFAULT_GYRO_TO_USE macro to specify which gyro to use by default rather than pruning gyro defines or creating redundant configurations. This approach maintains compatibility when the same target is used by multiple hardware variants from the same manufacturer.

Applied to files:

  • configs/XROTOR-H7/config.h
📚 Learning: 2025-07-23T13:43:50.456Z
Learnt from: ot0tot
PR: betaflight/config#0
File: :0-0
Timestamp: 2025-07-23T13:43:50.456Z
Learning: For Betaflight board configuration reviews, always verify that serial port defines (like ESC_SENSOR_UART, MSP_UART, GPS_UART, etc.) use valid SERIAL_PORT identifiers that match those defined in the Betaflight codebase at src/main/io/serial.h. Common valid identifiers include SERIAL_PORT_USART1, SERIAL_PORT_USART2, SERIAL_PORT_USART3, SERIAL_PORT_UART4, SERIAL_PORT_UART5, etc. Invalid identifiers like SERIAL_PORT_UART3 (should be SERIAL_PORT_USART3) will cause build failures.

Applied to files:

  • configs/XROTOR-H7/config.h
📚 Learning: 2025-07-23T13:43:50.456Z
Learnt from: ot0tot
PR: betaflight/config#0
File: :0-0
Timestamp: 2025-07-23T13:43:50.456Z
Learning: For Betaflight board configuration reviews, always verify that serial port defines use valid identifiers from the serialPortIdentifier_e enum in src/main/io/serial.h. Valid identifiers include: SERIAL_PORT_USB_VCP (20), SERIAL_PORT_SOFTSERIAL1 (30), SERIAL_PORT_SOFTSERIAL2 (31), SERIAL_PORT_LPUART1 (40), SERIAL_PORT_UART0 (50, if SERIAL_UART_FIRST_INDEX == 0), SERIAL_PORT_USART1 (51 or 50), SERIAL_PORT_USART2, SERIAL_PORT_USART3, SERIAL_PORT_UART4, SERIAL_PORT_UART5, SERIAL_PORT_USART6, SERIAL_PORT_USART7, SERIAL_PORT_USART8, SERIAL_PORT_UART9, SERIAL_PORT_USART10. While some aliases exist (like SERIAL_PORT_UART3 = SERIAL_PORT_USART3), prefer using the primary identifiers as referenced in the serialPortIdentifiers array to avoid build failures.

Applied to files:

  • configs/XROTOR-H7/config.h
📚 Learning: 2025-07-03T04:33:57.480Z
Learnt from: ot0tot
PR: betaflight/config#0
File: :0-0
Timestamp: 2025-07-03T04:33:57.480Z
Learning: Always verify that the BOARD_NAME define in each config.h matches the directory name it resides in (e.g., configs/AXISFLYINGF7AIO/config.h must have #define BOARD_NAME AXISFLYINGF7AIO). This check is required for all Betaflight board configuration reviews.

Applied to files:

  • configs/XROTOR-H7/config.h
📚 Learning: 2025-08-20T02:54:58.596Z
Learnt from: ot0tot
PR: betaflight/config#872
File: configs/HGLRCH743/config.h:82-83
Timestamp: 2025-08-20T02:54:58.596Z
Learning: For Betaflight board configuration reviews, the definitive source for validating UART pin assignments is the serial_uart_{platform}.c file in the Betaflight codebase (e.g., serial_uart_stm32h7xx.c for STM32H7xx platforms), not generic MCU datasheets. These files contain the exact pin mappings that Betaflight supports for each UART peripheral.

Applied to files:

  • configs/XROTOR-H7/config.h
📚 Learning: 2025-06-23T18:43:31.746Z
Learnt from: haslinghuis
PR: betaflight/config#822
File: configs/AXISFLYINGH7MINI/config.h:29-37
Timestamp: 2025-06-23T18:43:31.746Z
Learning: In Betaflight configuration files, feature enablement macros like USE_MAG are build options that can be controlled at compile time, while hardware instance definitions like MAG_I2C_INSTANCE are predefined in board configurations to assist with hardware mapping when those features are enabled at build time.

Applied to files:

  • configs/XROTOR-H7/config.h
📚 Learning: 2025-08-22T17:08:23.283Z
Learnt from: haslinghuis
PR: betaflight/config#879
File: configs/AIRBOTSUPERF4V2/config.h:42-45
Timestamp: 2025-08-22T17:08:23.283Z
Learning: In Betaflight board configurations, OSD feature flags like USE_OSD_SD (analog/MAX7456) and USE_OSD_HD (digital/MSP DisplayPort) are typically defined at build time by the build system, not in the individual board config.h files. Board configs can conditionally define OSD-related settings based on these build-time flags.

Applied to files:

  • configs/XROTOR-H7/config.h
📚 Learning: 2025-06-23T18:44:59.162Z
Learnt from: haslinghuis
PR: betaflight/config#822
File: configs/AXISFLYINGH7MINI/config.h:121-129
Timestamp: 2025-06-23T18:44:59.162Z
Learning: In Betaflight configuration files, USE_OSD_HD and USE_MAX7456 are for different OSD systems: USE_MAX7456 enables the MAX7456 analog OSD chip, while USE_OSD_HD enables HD/digital OSD via MSP. MSP_DISPLAYPORT_UART should be guarded by USE_OSD_HD, not USE_MAX7456, as they serve different OSD implementations.

Applied to files:

  • configs/XROTOR-H7/config.h
📚 Learning: 2025-07-28T16:44:59.686Z
Learnt from: haslinghuis
PR: betaflight/config#656
File: configs/IFLIGHT_F745_AIO/config.h:31-35
Timestamp: 2025-07-28T16:44:59.686Z
Learning: In Betaflight board configurations, when a board design uses the same physical gyro socket but different sensor variants across production batches (e.g., MPU6000 in older batches, ICM42688P in newer batches), the correct approach is to enable both sensor drivers (USE_GYRO_SPI_MPU6000 and USE_GYRO_SPI_ICM42688P) in the same configuration. This allows runtime auto-detection of which sensor is actually present without requiring separate board configurations for each hardware variant.

Applied to files:

  • configs/XROTOR-H7/config.h
📚 Learning: 2025-06-02T16:16:20.197Z
Learnt from: haslinghuis
PR: betaflight/config#0
File: :0-0
Timestamp: 2025-06-02T16:16:20.197Z
Learning: In STM32F405-based flight controller configurations, timer pin mappings must be carefully analyzed for DMA stream conflicts, especially between motor timers, LED strip timers, and SPI DMA assignments. Changes to TIMER_PIN_MAPPING should include verification that all required peripherals (motors, LED strip, blackbox SPI) can coexist without DMA conflicts.

Applied to files:

  • configs/XROTOR-H7/config.h
📚 Learning: 2025-08-28T20:45:36.652Z
Learnt from: haslinghuis
PR: betaflight/config#888
File: configs/ZEX_ATHENA_MINI/config.h:0-0
Timestamp: 2025-08-28T20:45:36.652Z
Learning: In STM32H743 Betaflight configurations, PA15 maps to TIM2_CH1 (timer index 2) as defined in timer_stm32h7xx.c. When used for GYRO_CLKIN functionality, it's recommended to use the macro name GYRO_1_CLKIN_PIN in TIMER_PIN_MAPPING for consistency with other pin definitions.

Applied to files:

  • configs/XROTOR-H7/config.h
📚 Learning: 2025-08-28T20:45:36.652Z
Learnt from: haslinghuis
PR: betaflight/config#888
File: configs/ZEX_ATHENA_MINI/config.h:0-0
Timestamp: 2025-08-28T20:45:36.652Z
Learning: In STM32H743 Betaflight configurations, PB0 can use multiple timer options including TIM1_CH2N, TIM3_CH3, and TIM8_CH2N as defined in timer_stm32h7xx.c. For CAMERA_CONTROL_PIN assignments, TIM3_CH3 (timer index 3) is the appropriate choice.

Applied to files:

  • configs/XROTOR-H7/config.h
📚 Learning: 2025-07-03T04:33:57.480Z
Learnt from: ot0tot
PR: betaflight/config#0
File: :0-0
Timestamp: 2025-07-03T04:33:57.480Z
Learning: Always verify that the `BOARD_NAME` define in config.h files exactly matches the directory name where the config file is located. For example, if the config file is in configs/AXISFLYINGF7AIO/config.h, then the BOARD_NAME should be defined as "AXISFLYINGF7AIO". This ensures proper board identification and configuration loading in Betaflight.

Applied to files:

  • configs/XROTOR-H7/config.h
🔇 Additional comments (9)
configs/XROTOR-H7/config.h (9)

24-27: BOARD_NAME/MCU/manufacturer IDs look correct.

Values match the directory name and target MCU.


37-44: Baro/Mag on I2C2 OK.

Shared I2C2 instance matches the stated hardware.


49-53: Confirm beeper polarity.

BEEPER_INVERTED at 3 kHz assumes an active-low driver (common with NPN/open-drain). Please confirm the board’s beeper transistor stage matches this.


55-62: Timers/DMA mapping seems coherent but warrants a quick conflict check.

TIM1/TIM4 for motors, TIM15 for servos, TIM5 for beeper/LED, and explicit DMA opts look fine. Recommend a quick build/run check with DMA conflict diagnostics to ensure SPIx/ADC and TIMUPx selections don’t collide under DMAMUX.

Also applies to: 155-171, 174-186


72-76: CLKIN pins use TIM16/TIM17; verify BF support for these as GYRO_CLKIN sources.

PB8 (TIM16_CH1) and PB9 (TIM17_CH1) are valid timer channels on H743, but not all timers are accepted as CLKIN sources across targets. Please verify timer_stm32h7xx.c includes these channels for GYRO_CLKIN, or consider TIM2_CH1 on PA15 if hardware permits (it doesn’t here due to MAX7456 CS).

Also applies to: 155-171


116-123: MAX7456 on SPI3 with CS on PA15 looks fine with SWD-only debug.

PA15 overlaps with JTAG JTDI but not SWD. Since you define SWDIO/SWCLK only, this is OK.

Also applies to: 151-154


187-196: PINIO defaults align with “CAM 1,2” and “SW_VTX”.

Looks consistent with the PR objectives.


139-150: Confirm voltage meter macro in Betaflight source.
Ripgrep didn’t find any matches—please rerun the search from your Betaflight repo root (e.g. rg -n "DEFAULT_VOLTAGE_METER_SCALE(_DEFAULT)?" -C2) to determine whether DEFAULT_VOLTAGE_METER_SCALE_DEFAULT or DEFAULT_VOLTAGE_METER_SCALE is actually referenced, then adjust the define in configs/XROTOR-H7/config.h accordingly.


107-108: UART5 pin mapping is invalid for STM32H743 and conflicts with SDIO alternatives.

PB6/PB5 are not valid UART5 pins (they’re USART1/LPUART1 alts). Valid UART5 TX/RX are typically PC12/PD2, which you’re using for SDIO (CK/CMD). This will misconfigure or create a non-functional port.

Suggested fix: drop UART5 entirely to avoid invalid mapping and SDIO conflicts:

-#define UART5_TX_PIN                  PB6     //
-#define UART5_RX_PIN                  PB5     //

If UART5 is required, remap SDIO or pick a supported UART5 pin pair (e.g., PC12/PD2), but that would sacrifice SDIO.

⛔ Skipped due to learnings
Learnt from: osirisinferi
PR: betaflight/config#872
File: configs/HGLRCH743/config.h:82-83
Timestamp: 2025-08-19T18:34:22.887Z
Learning: For STM32H743, both UART5_TX (PB6) and UART5_RX (PB5) use alternate function AF14, not AF8. The Port B alternate functions table in the STM32H743 datasheet confirms PB5 supports UART5_RX and PB6 supports UART5_TX, both using AF14.
Learnt from: haslinghuis
PR: betaflight/config#870
File: configs/ZEX_ATHENA_STD_PRO/config.h:54-55
Timestamp: 2025-08-21T11:11:19.213Z
Learning: For STM32H743 in Betaflight, UART4 can use PB8 (UART4_RX) and PB9 (UART4_TX) with GPIO_AF8_UART4, as confirmed in the official Betaflight codebase at src/platform/STM32/serial_uart_stm32h7xx.c. This is a valid pin mapping despite what some generic STM32 documentation might suggest.
Learnt from: haslinghuis
PR: betaflight/config#870
File: configs/ZEX_ATHENA_STD_PRO/config.h:54-55
Timestamp: 2025-08-21T11:11:19.213Z
Learning: For STM32H743 in Betaflight, UART4 can use PB8 (UART4_RX) and PB9 (UART4_TX) as confirmed in the official Betaflight codebase at src/platform/STM32/serial_uart_stm32h7xx.c. This contradicts some generic STM32 documentation that might not show all supported pin configurations used by Betaflight.
Learnt from: haslinghuis
PR: betaflight/config#888
File: configs/ZEX_ATHENA_MINI/config.h:0-0
Timestamp: 2025-08-28T20:45:36.652Z
Learning: In STM32H743 Betaflight configurations, PA15 maps to TIM2_CH1 (timer index 2) as defined in timer_stm32h7xx.c. When used for GYRO_CLKIN functionality, it's recommended to use the macro name GYRO_1_CLKIN_PIN in TIMER_PIN_MAPPING for consistency with other pin definitions.
Learnt from: ot0tot
PR: betaflight/config#0
File: :0-0
Timestamp: 2025-07-23T13:43:50.456Z
Learning: For Betaflight board configuration reviews, always verify that serial port defines (like ESC_SENSOR_UART, MSP_UART, GPS_UART, etc.) use valid SERIAL_PORT identifiers that match those defined in the Betaflight codebase at src/main/io/serial.h. Common valid identifiers include SERIAL_PORT_USART1, SERIAL_PORT_USART2, SERIAL_PORT_USART3, SERIAL_PORT_UART4, SERIAL_PORT_UART5, etc. Invalid identifiers like SERIAL_PORT_UART3 (should be SERIAL_PORT_USART3) will cause build failures.
Learnt from: ot0tot
PR: betaflight/config#834
File: configs/RADIOLINKF405/config.h:79-88
Timestamp: 2025-07-14T15:41:14.364Z
Learning: In STM32F405 configurations, PB1 typically maps to TIM3_CH4 and PC9 typically maps to TIM8_CH4. These are different timers and do not share DMA resources, so there is no conflict when both pins are used simultaneously (e.g., PB1 for LED_STRIP and PC9 for MOTOR4).
Learnt from: haslinghuis
PR: betaflight/config#881
File: configs/GEPRC_TAKER_H743MINI/config.h:86-99
Timestamp: 2025-09-01T19:58:52.005Z
Learning: For STM32H743 in Betaflight, PB0 has multiple timer options but only timer index 2 provides a non-complementary output suitable for GYRO_CLKIN functionality. The other timer options for PB0 are N channels (complementary outputs) which are not appropriate for CLKIN usage.
Learnt from: ot0tot
PR: betaflight/config#872
File: configs/HGLRCH743/config.h:82-83
Timestamp: 2025-08-20T02:54:58.596Z
Learning: For Betaflight board configuration reviews, the definitive source for validating UART pin assignments is the serial_uart_{platform}.c file in the Betaflight codebase (e.g., serial_uart_stm32h7xx.c for STM32H7xx platforms), not generic MCU datasheets. These files contain the exact pin mappings that Betaflight supports for each UART peripheral.
Learnt from: haslinghuis
PR: betaflight/config#883
File: configs/HGLRCF435_AIO/config.h:50-58
Timestamp: 2025-08-26T14:26:11.863Z
Learning: For AT32F435 in Betaflight, UART4 supports multiple pin options including PH2 (UART4_RX) and PH3 (UART4_TX) with GPIO_MUX_8, as confirmed in the official Betaflight codebase at src/platform/AT32/serial_uart_at32f43x.c. The AT32 platform has broader pin support than initially apparent from basic searches.
Learnt from: haslinghuis
PR: betaflight/config#883
File: configs/HGLRCF435_AIO/config.h:50-58
Timestamp: 2025-08-26T14:26:11.863Z
Learning: For AT32F435 in Betaflight, UART4 can use PH2 (UART4_RX) and PH3 (UART4_TX) as confirmed in the official Betaflight codebase at src/platform/AT32/serial_uart_at32f43x.c lines 183-212. This is a valid pin mapping for the AT32F435 platform.

@Arwayday Arwayday requested a review from haslinghuis September 9, 2025 05:38
Co-authored-by: Mark Haslinghuis <[email protected]>
@haslinghuis haslinghuis requested a review from ot0tot September 15, 2025 19:14
Arwayday and others added 3 commits September 19, 2025 11:21
Due to the default orientation issue between the MPU6000 and the ICM42688P, the MPU6000 driver has been removed.

Co-authored-by: ot0tot <[email protected]>
Remove unused barometers

Co-authored-by: ot0tot <[email protected]>
Correct the erroneous current scale and offset values.
@Arwayday Arwayday requested a review from ot0tot September 19, 2025 07:36
Arwayday and others added 4 commits September 20, 2025 14:57
Remove the macro that enables the ESC telemetry (feedback) interface by default.

Co-authored-by: ot0tot <[email protected]>
Remove the default voltage-divider (VBAT) ratio setting.

Co-authored-by: ot0tot <[email protected]>
Add essential comments to ease review.
Fix incorrect macro definitions; optimize timer configuration.
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
configs/HWH7/config.h (2)

176-188: PINIO3_BOX = 0 is suspicious; either assign a real box or drop PINIO3

BOX id 0 usually maps to ARM; you probably don’t want PINIO3 toggled by ARM. Recommend removing PINIO3 defaults if unused.

-#define PINIO3_PIN PD10
-#define PINIO3_BOX 0
-#define PINIO3_CONFIG 129

147-149: Remove unused USE_SWDIO_PIN / USE_SWCLK_PIN macros

Defined only in board config headers and not referenced elsewhere; remove to reduce noise or keep only as board‑pad documentation.

Locations: configs/HWH7/config.h:147-148, configs/STELLARH7DEV/config.h:176-177, configs/DRONEERH743DUAL/config.h:154-155

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d309bf6 and 310cfe2.

📒 Files selected for processing (1)
  • configs/HWH7/config.h (1 hunks)
🧰 Additional context used
🧠 Learnings (33)
📓 Common learnings
Learnt from: haslinghuis
PR: betaflight/config#835
File: configs/HDZERO_HALO_MPU6000/config.h:44-56
Timestamp: 2025-07-14T16:16:56.822Z
Learning: For Betaflight board configurations of boards already in production, pin assignments in config.h files reflect the actual hardware design and cannot be changed, even if they present potential conflicts with debug interfaces. The configuration must match the physical board layout, not ideal software design preferences.
📚 Learning: 2025-07-14T16:16:56.822Z
Learnt from: haslinghuis
PR: betaflight/config#835
File: configs/HDZERO_HALO_MPU6000/config.h:44-56
Timestamp: 2025-07-14T16:16:56.822Z
Learning: For Betaflight board configurations of boards already in production, pin assignments in config.h files reflect the actual hardware design and cannot be changed, even if they present potential conflicts with debug interfaces. The configuration must match the physical board layout, not ideal software design preferences.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-07-03T04:33:57.480Z
Learnt from: ot0tot
PR: betaflight/config#0
File: :0-0
Timestamp: 2025-07-03T04:33:57.480Z
Learning: Always verify that the BOARD_NAME define in each config.h matches the directory name it resides in (e.g., configs/AXISFLYINGF7AIO/config.h must have #define BOARD_NAME AXISFLYINGF7AIO). This check is required for all Betaflight board configuration reviews.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-07-23T13:43:50.456Z
Learnt from: ot0tot
PR: betaflight/config#0
File: :0-0
Timestamp: 2025-07-23T13:43:50.456Z
Learning: For Betaflight board configuration reviews, always verify that serial port defines (like ESC_SENSOR_UART, MSP_UART, GPS_UART, etc.) use valid SERIAL_PORT identifiers that match those defined in the Betaflight codebase at src/main/io/serial.h. Common valid identifiers include SERIAL_PORT_USART1, SERIAL_PORT_USART2, SERIAL_PORT_USART3, SERIAL_PORT_UART4, SERIAL_PORT_UART5, etc. Invalid identifiers like SERIAL_PORT_UART3 (should be SERIAL_PORT_USART3) will cause build failures.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-08-22T17:08:23.283Z
Learnt from: haslinghuis
PR: betaflight/config#879
File: configs/AIRBOTSUPERF4V2/config.h:42-45
Timestamp: 2025-08-22T17:08:23.283Z
Learning: In Betaflight board configurations, OSD feature flags like USE_OSD_SD (analog/MAX7456) and USE_OSD_HD (digital/MSP DisplayPort) are typically defined at build time by the build system, not in the individual board config.h files. Board configs can conditionally define OSD-related settings based on these build-time flags.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-07-03T04:33:57.480Z
Learnt from: ot0tot
PR: betaflight/config#0
File: :0-0
Timestamp: 2025-07-03T04:33:57.480Z
Learning: Always verify that the `BOARD_NAME` define in config.h files exactly matches the directory name where the config file is located. For example, if the config file is in configs/AXISFLYINGF7AIO/config.h, then the BOARD_NAME should be defined as "AXISFLYINGF7AIO". This ensures proper board identification and configuration loading in Betaflight.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-07-23T13:43:50.456Z
Learnt from: ot0tot
PR: betaflight/config#0
File: :0-0
Timestamp: 2025-07-23T13:43:50.456Z
Learning: For Betaflight board configuration reviews, always verify that serial port defines use valid identifiers from the serialPortIdentifier_e enum in src/main/io/serial.h. Valid identifiers include: SERIAL_PORT_USB_VCP (20), SERIAL_PORT_SOFTSERIAL1 (30), SERIAL_PORT_SOFTSERIAL2 (31), SERIAL_PORT_LPUART1 (40), SERIAL_PORT_UART0 (50, if SERIAL_UART_FIRST_INDEX == 0), SERIAL_PORT_USART1 (51 or 50), SERIAL_PORT_USART2, SERIAL_PORT_USART3, SERIAL_PORT_UART4, SERIAL_PORT_UART5, SERIAL_PORT_USART6, SERIAL_PORT_USART7, SERIAL_PORT_USART8, SERIAL_PORT_UART9, SERIAL_PORT_USART10. While some aliases exist (like SERIAL_PORT_UART3 = SERIAL_PORT_USART3), prefer using the primary identifiers as referenced in the serialPortIdentifiers array to avoid build failures.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-06-23T18:43:31.746Z
Learnt from: haslinghuis
PR: betaflight/config#822
File: configs/AXISFLYINGH7MINI/config.h:29-37
Timestamp: 2025-06-23T18:43:31.746Z
Learning: In Betaflight configuration files, feature enablement macros like USE_MAG are build options that can be controlled at compile time, while hardware instance definitions like MAG_I2C_INSTANCE are predefined in board configurations to assist with hardware mapping when those features are enabled at build time.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-08-20T02:54:58.596Z
Learnt from: ot0tot
PR: betaflight/config#872
File: configs/HGLRCH743/config.h:82-83
Timestamp: 2025-08-20T02:54:58.596Z
Learning: For Betaflight board configuration reviews, the definitive source for validating UART pin assignments is the serial_uart_{platform}.c file in the Betaflight codebase (e.g., serial_uart_stm32h7xx.c for STM32H7xx platforms), not generic MCU datasheets. These files contain the exact pin mappings that Betaflight supports for each UART peripheral.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-07-28T16:44:59.686Z
Learnt from: haslinghuis
PR: betaflight/config#656
File: configs/IFLIGHT_F745_AIO/config.h:31-35
Timestamp: 2025-07-28T16:44:59.686Z
Learning: In Betaflight board configurations, when a board design uses the same physical gyro socket but different sensor variants across production batches (e.g., MPU6000 in older batches, ICM42688P in newer batches), the correct approach is to enable both sensor drivers (USE_GYRO_SPI_MPU6000 and USE_GYRO_SPI_ICM42688P) in the same configuration. This allows runtime auto-detection of which sensor is actually present without requiring separate board configurations for each hardware variant.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-06-23T18:44:59.162Z
Learnt from: haslinghuis
PR: betaflight/config#822
File: configs/AXISFLYINGH7MINI/config.h:121-129
Timestamp: 2025-06-23T18:44:59.162Z
Learning: In Betaflight configuration files, USE_OSD_HD and USE_MAX7456 are for different OSD systems: USE_MAX7456 enables the MAX7456 analog OSD chip, while USE_OSD_HD enables HD/digital OSD via MSP. MSP_DISPLAYPORT_UART should be guarded by USE_OSD_HD, not USE_MAX7456, as they serve different OSD implementations.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-06-08T22:02:28.961Z
Learnt from: haslinghuis
PR: betaflight/config#814
File: configs/JHEF405PRO/config.h:109-109
Timestamp: 2025-06-08T22:02:28.961Z
Learning: The JHEF405PRO board does not actually use dual gyros despite having GYRO_2_SPI_INSTANCE defined in its configuration. It should not receive GYRO_COUNT or other dual-gyro related definitions since only the first gyro is supported.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-05-28T15:45:15.608Z
Learnt from: haslinghuis
PR: betaflight/config#792
File: configs/MERAKRCF722/config.h:32-32
Timestamp: 2025-05-28T15:45:15.608Z
Learning: The presence of GYRO_2_SPI_INSTANCE definition in a board config does not necessarily mean the board uses dual gyros. Some boards have GYRO_2_SPI_INSTANCE defined but it's not actually used, so they should not receive GYRO_COUNT or other dual-gyro related definitions. Only boards that actually utilize dual gyros should get these definitions.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-07-03T15:17:30.040Z
Learnt from: haslinghuis
PR: betaflight/config#0
File: :0-0
Timestamp: 2025-07-03T15:17:30.040Z
Learning: In Betaflight configurations, when a target name suggests dual IMUs (like JHEF7DUAL) but specific hardware variants only have one gyro available, the preferred solution is to use DEFAULT_GYRO_TO_USE macro to specify which gyro to use by default rather than pruning gyro defines or creating redundant configurations. This approach maintains compatibility when the same target is used by multiple hardware variants from the same manufacturer.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-07-25T20:06:07.492Z
Learnt from: haslinghuis
PR: betaflight/config#719
File: configs/SPEDIXG473/config.h:29-38
Timestamp: 2025-07-25T20:06:07.492Z
Learning: BMP280 and DPS310 barometer drivers in Betaflight do not require USE_I2C to be explicitly defined in board configurations. Many existing boards successfully use USE_BARO_BMP280 and USE_BARO_DPS310 without defining USE_I2C, indicating that the I2C dependency is handled automatically by the build system or these sensors support alternative communication methods.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-07-25T20:06:07.492Z
Learnt from: haslinghuis
PR: betaflight/config#719
File: configs/SPEDIXG473/config.h:29-38
Timestamp: 2025-07-25T20:06:07.492Z
Learning: BMP280 and DPS310 barometer drivers in Betaflight do not require USE_I2C to be explicitly defined in board configurations. Out of 264 boards using these drivers, 259 (98%) work without USE_I2C defined, indicating that the I2C dependency is handled automatically by the build system.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-05-28T15:48:18.449Z
Learnt from: haslinghuis
PR: betaflight/config#792
File: configs/FLYWOOF411/config.h:33-33
Timestamp: 2025-05-28T15:48:18.449Z
Learning: The FLYWOOF411 board does not actually use dual gyros despite having GYRO_2_SPI_INSTANCE defined in its configuration. It was incorrectly targeted for GYRO_COUNT and dual gyro support.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-06-02T16:16:20.197Z
Learnt from: haslinghuis
PR: betaflight/config#0
File: :0-0
Timestamp: 2025-06-02T16:16:20.197Z
Learning: In STM32F405-based flight controller configurations, timer pin mappings must be carefully analyzed for DMA stream conflicts, especially between motor timers, LED strip timers, and SPI DMA assignments. Changes to TIMER_PIN_MAPPING should include verification that all required peripherals (motors, LED strip, blackbox SPI) can coexist without DMA conflicts.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-05-31T17:01:39.423Z
Learnt from: haslinghuis
PR: betaflight/config#798
File: configs/FURYF4OSD/config.h:88-88
Timestamp: 2025-05-31T17:01:39.423Z
Learning: For STM32F4xx platforms, PB1 pin timer definitions are:
1 = DEF_TIM(TIM1, CH3N, PB1, 0, 0)
2 = DEF_TIM(TIM3, CH4, PB1, 0, 0) 
3 = DEF_TIM(TIM8, CH3N, PB1, 0, 0)
Timer instance 2 (TIM3, CH4) is the correct mapping for PB1 motor control on STM32F4xx platforms as defined in src/platform/STM32/timer_stm32f4xx.c

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-07-14T15:41:14.364Z
Learnt from: ot0tot
PR: betaflight/config#834
File: configs/RADIOLINKF405/config.h:79-88
Timestamp: 2025-07-14T15:41:14.364Z
Learning: In STM32F405 configurations, PB1 typically maps to TIM3_CH4 and PC9 typically maps to TIM8_CH4. These are different timers and do not share DMA resources, so there is no conflict when both pins are used simultaneously (e.g., PB1 for LED_STRIP and PC9 for MOTOR4).

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-08-28T20:45:36.652Z
Learnt from: haslinghuis
PR: betaflight/config#888
File: configs/ZEX_ATHENA_MINI/config.h:0-0
Timestamp: 2025-08-28T20:45:36.652Z
Learning: In STM32H743 Betaflight configurations, PB0 can use multiple timer options including TIM1_CH2N, TIM3_CH3, and TIM8_CH2N as defined in timer_stm32h7xx.c. For CAMERA_CONTROL_PIN assignments, TIM3_CH3 (timer index 3) is the appropriate choice.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-08-28T20:45:36.652Z
Learnt from: haslinghuis
PR: betaflight/config#888
File: configs/ZEX_ATHENA_MINI/config.h:0-0
Timestamp: 2025-08-28T20:45:36.652Z
Learning: In STM32H743 Betaflight configurations, PA15 maps to TIM2_CH1 (timer index 2) as defined in timer_stm32h7xx.c. When used for GYRO_CLKIN functionality, it's recommended to use the macro name GYRO_1_CLKIN_PIN in TIMER_PIN_MAPPING for consistency with other pin definitions.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-06-02T16:16:20.197Z
Learnt from: haslinghuis
PR: betaflight/config#0
File: :0-0
Timestamp: 2025-06-02T16:16:20.197Z
Learning: For Betaflight configurations, blackbox logging via SPI3 and LED_STRIP functionality can be mutually exclusive due to DMA stream conflicts on STM32F4 targets. This hardware limitation should be identified during timer configuration reviews.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-07-14T15:38:58.935Z
Learnt from: ot0tot
PR: betaflight/config#834
File: configs/RADIOLINKF405/config.h:54-54
Timestamp: 2025-07-14T15:38:58.935Z
Learning: ESC sensor communication in Betaflight is unidirectional and only requires the UART RX pin. It does not need bidirectional communication, so UART_TX_PIN definitions are not required for ESC sensor UARTs. Some flight controller boards may not even expose the TX pin for the UART designated for ESC sensor use.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-08-21T11:11:19.213Z
Learnt from: haslinghuis
PR: betaflight/config#870
File: configs/ZEX_ATHENA_STD_PRO/config.h:54-55
Timestamp: 2025-08-21T11:11:19.213Z
Learning: For STM32H743 in Betaflight, UART4 can use PB8 (UART4_RX) and PB9 (UART4_TX) as confirmed in the official Betaflight codebase at src/platform/STM32/serial_uart_stm32h7xx.c. This contradicts some generic STM32 documentation that might not show all supported pin configurations used by Betaflight.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-08-21T11:11:19.213Z
Learnt from: haslinghuis
PR: betaflight/config#870
File: configs/ZEX_ATHENA_STD_PRO/config.h:54-55
Timestamp: 2025-08-21T11:11:19.213Z
Learning: For STM32H743 in Betaflight, UART4 can use PB8 (UART4_RX) and PB9 (UART4_TX) with GPIO_AF8_UART4, as confirmed in the official Betaflight codebase at src/platform/STM32/serial_uart_stm32h7xx.c. This is a valid pin mapping despite what some generic STM32 documentation might suggest.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-07-14T15:38:06.837Z
Learnt from: ot0tot
PR: betaflight/config#834
File: configs/RADIOLINKF405/config.h:52-53
Timestamp: 2025-07-14T15:38:06.837Z
Learning: In Betaflight flight controller configurations, it's common and intentional for UART2_RX_PIN and RX_PPM_PIN to share the same GPIO pin (like PA3) because they represent mutually exclusive receiver input protocols. The pin can be configured for either serial receiver input (UART2) or PPM input, but not both simultaneously. This is a standard design pattern in flight controller hardware.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-08-26T14:26:11.863Z
Learnt from: haslinghuis
PR: betaflight/config#883
File: configs/HGLRCF435_AIO/config.h:50-58
Timestamp: 2025-08-26T14:26:11.863Z
Learning: For AT32F435 in Betaflight, UART4 supports multiple pin options including PH2 (UART4_RX) and PH3 (UART4_TX) with GPIO_MUX_8, as confirmed in the official Betaflight codebase at src/platform/AT32/serial_uart_at32f43x.c. The AT32 platform has broader pin support than initially apparent from basic searches.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-09-01T19:58:52.049Z
Learnt from: haslinghuis
PR: betaflight/config#881
File: configs/GEPRC_TAKER_H743MINI/config.h:86-99
Timestamp: 2025-09-01T19:58:52.049Z
Learning: For STM32H743 PB0 in Betaflight, there are three timer options: TIM1_CH2N, TIM3_CH3, and TIM8_CH2N. Only TIM3_CH3 (timer index 2) is suitable for GYRO_CLKIN as the other two are complementary (N) channels. This is confirmed in timer_stm32h7xx.c.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-09-01T19:58:52.049Z
Learnt from: haslinghuis
PR: betaflight/config#881
File: configs/GEPRC_TAKER_H743MINI/config.h:86-99
Timestamp: 2025-09-01T19:58:52.049Z
Learning: For STM32H743 in Betaflight, PB0 has multiple timer options but only timer index 2 provides a non-complementary output suitable for GYRO_CLKIN functionality. The other timer options for PB0 are N channels (complementary outputs) which are not appropriate for CLKIN usage.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-08-10T14:08:56.662Z
Learnt from: blckmn
PR: betaflight/config#851
File: configs/HELLBENDER_0001/config.h:45-46
Timestamp: 2025-08-10T14:08:56.662Z
Learning: In Betaflight, USE_LED_STRIP is a cloud build option that enables/disables the LED strip feature at build time. Individual target config files (configs/*/config.h) only need to define LED_STRIP_PIN as a default pin assignment - they should not define USE_LED_STRIP themselves. The feature enablement is handled externally through the cloud build system, not through preprocessor directives in the config files.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-07-08T22:26:29.906Z
Learnt from: haslinghuis
PR: betaflight/config#829
File: configs/HELLBENDER_0001/config.h:53-56
Timestamp: 2025-07-08T22:26:29.906Z
Learning: In Betaflight configurations, SDCARD_CS_PIN and FLASH_CS_PIN can share the same GPIO pin because Betaflight uses either flash or sdcard storage, not both simultaneously. This is a mutually exclusive design where only one storage method is active at a time, so shared CS pin assignments are intentional and do not cause conflicts.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-07-14T16:16:50.628Z
Learnt from: haslinghuis
PR: betaflight/config#835
File: configs/HDZERO_HALO_MPU6000/config.h:29-35
Timestamp: 2025-07-14T16:16:50.628Z
Learning: GYRO_1_SPI_CLOCK_DIVIDER is not used in any Betaflight target configuration files. SPI clock frequency settings are not commonly configured at the target level.

Applied to files:

  • configs/HWH7/config.h
🔇 Additional comments (17)
configs/HWH7/config.h (17)

24-26: BOARD_NAME/manufacturer/MCU: looks correct and consistent with path

HWH7 matches configs/HWH7/, MANUFACTURER_ID is 4 chars, MCU is STM32H743.


28-34: ICM-42688P-only: aligned with hardware and prior discussion

Only ICM42688P drivers enabled for ACC/GYRO; MPU6000 removed as per earlier feedback.


36-40: Baro/mag I2C on I2C2: good; no explicit USE_I2C needed

DPS310 selected; MAG instance predeclared for optional use. Matches common patterns.


49-58: Motor outputs on TIM1/TIM4: standard, no conflicts spotted

PE9/11/13/14 for TIM1 and PD12–PD15 for TIM4 are valid pairings.


60-62: Servos on TIM15: valid pins

PE5/PE6 map to TIM15 CH1/CH2 as expected.


64-66: I2C2 pins PB10/PB11: OK

No overlap with other assigned critical functions.


95-111: UART mapping correctness: confirm PD0/PD1 for UART4; caution on UART1 default for CRSF

  • Please verify UART4 supports PD0/PD1 on H743 in Betaflight’s serial mappings.
  • Note: Using UART1 for receivers can be hijacked by DFU/boot if USB‑powered; consider documenting this caveat.
#!/bin/bash
# Verify UART4 pin options and UART identifiers
rg -n -C3 -g 'src/**/serial_uart_stm32h7xx.c' 'UART4|PD0|PD1|PB8|PB9'
rg -n -C2 -g 'src/**/serial.h' 'serialPortIdentifier_e|SERIAL_PORT_UART4|SERIAL_PORT_USART1'

121-134: SDMMC (4‑bit) and Blackbox default to SD card: LGTM

Pins and device selection look correct.


167-167: DSHOT bitbang default ON: acceptable on H7

Fine as a default; many H7 targets do this.


190-199: Defaults: CRSF on USART1, MSP on USART3, MSP‑DP under USE_OSD_HD, GPS on UART4 under USE_GPS

Matches conventions and earlier suggestions. Please keep the UART1/USB caveat in mind.


136-145: Confirm current‑meter scale vs hardware (shunt/divider & ADC Vref)

Repo search shows DEFAULT_CURRENT_METER_SCALE = 117 and DEFAULT_CURRENT_METER_OFFSET = 0 in configs/HWH7/config.h (lines 143–144). Confirm 117 matches the board's shunt resistor, ADC input divider and ADC Vref, or provide shunt/divider/Vref so the correct scale/offset can be calculated.


151-166: Timer map indices: double‑check chosen alternatives

  • Motors: indices 1..7 with MOTOR8 -1 match the earlier guidance.
  • BEEPER index 2 and LED_STRIP index 1 should land on different timers (TIM5 vs TIM2).
    Please confirm with timer table to avoid silent conflicts.

74-93: Gyro buses/EXTI: confirm PC14/PC15 availability

PC14/PC15 are commonly LSE pins; ensure they’re not used for a crystal on this board and are free for EXTI to the IMUs.


68-73: Gyro CLKIN on PB8/PB9: confirm timer support and mapping

PB8→TIM16_CH1 and PB9→TIM17_CH1 should be fine for CLKIN. Please confirm these pins exist with those channels in timer_stm32h7xx.c and that TIMER_PIN_MAP indices select the intended option.

Also applies to: 151-166


113-119: Confirm PD6 as SPI3 SDO (STM32H7) — PD6 is set as SPI3_SDO_PIN in configs/HWH7 (lines 113–118) and many other H7 configs (e.g. SPRACINGH7NANO, SPRACINGH7ZERO, NBD_INFINITYAIO255). src/platform/spi_stm32h7xx.c (canonical SPI pin table) is not present in this branch, so the platform mapping couldn't be verified here — confirm PD6 is supported by the STM32H7 SPI3 driver or change to a known-supported MOSI pin.


41-48: Verify PA0/PA1 timer selection in timer_stm32h7xx.c
configs/HWH7/config.h sets LED_STRIP PA0 alt‑index 1 and BEEPER PA1 alt‑index 2 (TIMER_PIN_MAPPING lines 151–165); timer_stm32h7xx.c is not in this repo — confirm alt‑index 1 → TIM2_CH1 and alt‑index 2 → TIM5_CH2 so LED strip and beeper use different timers.


169-174: Verify DMA option numbers map to intended DMA streams

configs/HWH7/config.h (lines 170–174) sets TIMUP1_DMA_OPT=8, TIMUP4_DMA_OPT=9, ADC1_DMA_OPT=11, ADC3_DMA_OPT=12 — this repo only contains config headers, the mapping from these option indices to actual DMA controller/stream/channel lives in the firmware; verify against the firmware DMA-option table or run the firmware CLI "timer map" (compile with EXTRA_FLAGS=-DUSE_TIMER_MAP_PRINT) to ensure no DMA stream/channel conflicts.

Arwayday and others added 2 commits September 21, 2025 09:45
Remove default receiver UART configuration.

Co-authored-by: ot0tot <[email protected]>
Copy link
Contributor

@osirisinferi osirisinferi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
configs/HWH7/config.h (2)

168-168: Consider not forcing DSHOT bitbang ON by default

H7 has robust timer/DMA; bitbang can add CPU load. Suggest leaving default unset or OFF and let users enable if needed.

-#define DEFAULT_DSHOT_BITBANG           DSHOT_BITBANG_ON
+/* Leave DSHOT bitbang to user configuration; hardware DSHOT is preferred on H7 */
+/* #define DEFAULT_DSHOT_BITBANG        DSHOT_BITBANG_OFF */

95-112: UART5 PB6/PB5 confirmed; replace Chinese comments with English

Confirmed: serial_uart_stm32h7xx.c defines UART5 RX=PB5 and TX=PB6 with GPIO_AF14, and UART4 PD0/PD1 are present with GPIO_AF8. Update comments in configs/HWH7/config.h (lines 95-112) to English for consistency.

-#define UART4_TX_PIN                  PD1     // 仅串口功能
-#define UART4_RX_PIN                  PD0     // 仅串口功能
+#define UART4_TX_PIN                  PD1     // UART function only (no shared alt use)
+#define UART4_RX_PIN                  PD0     // UART function only (no shared alt use)
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 310cfe2 and b66b067.

📒 Files selected for processing (1)
  • configs/HWH7/config.h (1 hunks)
🧰 Additional context used
🧠 Learnings (32)
📓 Common learnings
Learnt from: haslinghuis
PR: betaflight/config#835
File: configs/HDZERO_HALO_MPU6000/config.h:44-56
Timestamp: 2025-07-14T16:16:56.822Z
Learning: For Betaflight board configurations of boards already in production, pin assignments in config.h files reflect the actual hardware design and cannot be changed, even if they present potential conflicts with debug interfaces. The configuration must match the physical board layout, not ideal software design preferences.
📚 Learning: 2025-07-14T16:16:56.822Z
Learnt from: haslinghuis
PR: betaflight/config#835
File: configs/HDZERO_HALO_MPU6000/config.h:44-56
Timestamp: 2025-07-14T16:16:56.822Z
Learning: For Betaflight board configurations of boards already in production, pin assignments in config.h files reflect the actual hardware design and cannot be changed, even if they present potential conflicts with debug interfaces. The configuration must match the physical board layout, not ideal software design preferences.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-07-03T04:33:57.480Z
Learnt from: ot0tot
PR: betaflight/config#0
File: :0-0
Timestamp: 2025-07-03T04:33:57.480Z
Learning: Always verify that the BOARD_NAME define in each config.h matches the directory name it resides in (e.g., configs/AXISFLYINGF7AIO/config.h must have #define BOARD_NAME AXISFLYINGF7AIO). This check is required for all Betaflight board configuration reviews.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-07-23T13:43:50.456Z
Learnt from: ot0tot
PR: betaflight/config#0
File: :0-0
Timestamp: 2025-07-23T13:43:50.456Z
Learning: For Betaflight board configuration reviews, always verify that serial port defines (like ESC_SENSOR_UART, MSP_UART, GPS_UART, etc.) use valid SERIAL_PORT identifiers that match those defined in the Betaflight codebase at src/main/io/serial.h. Common valid identifiers include SERIAL_PORT_USART1, SERIAL_PORT_USART2, SERIAL_PORT_USART3, SERIAL_PORT_UART4, SERIAL_PORT_UART5, etc. Invalid identifiers like SERIAL_PORT_UART3 (should be SERIAL_PORT_USART3) will cause build failures.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-08-22T17:08:23.283Z
Learnt from: haslinghuis
PR: betaflight/config#879
File: configs/AIRBOTSUPERF4V2/config.h:42-45
Timestamp: 2025-08-22T17:08:23.283Z
Learning: In Betaflight board configurations, OSD feature flags like USE_OSD_SD (analog/MAX7456) and USE_OSD_HD (digital/MSP DisplayPort) are typically defined at build time by the build system, not in the individual board config.h files. Board configs can conditionally define OSD-related settings based on these build-time flags.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-07-03T04:33:57.480Z
Learnt from: ot0tot
PR: betaflight/config#0
File: :0-0
Timestamp: 2025-07-03T04:33:57.480Z
Learning: Always verify that the `BOARD_NAME` define in config.h files exactly matches the directory name where the config file is located. For example, if the config file is in configs/AXISFLYINGF7AIO/config.h, then the BOARD_NAME should be defined as "AXISFLYINGF7AIO". This ensures proper board identification and configuration loading in Betaflight.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-06-23T18:43:31.746Z
Learnt from: haslinghuis
PR: betaflight/config#822
File: configs/AXISFLYINGH7MINI/config.h:29-37
Timestamp: 2025-06-23T18:43:31.746Z
Learning: In Betaflight configuration files, feature enablement macros like USE_MAG are build options that can be controlled at compile time, while hardware instance definitions like MAG_I2C_INSTANCE are predefined in board configurations to assist with hardware mapping when those features are enabled at build time.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-07-23T13:43:50.456Z
Learnt from: ot0tot
PR: betaflight/config#0
File: :0-0
Timestamp: 2025-07-23T13:43:50.456Z
Learning: For Betaflight board configuration reviews, always verify that serial port defines use valid identifiers from the serialPortIdentifier_e enum in src/main/io/serial.h. Valid identifiers include: SERIAL_PORT_USB_VCP (20), SERIAL_PORT_SOFTSERIAL1 (30), SERIAL_PORT_SOFTSERIAL2 (31), SERIAL_PORT_LPUART1 (40), SERIAL_PORT_UART0 (50, if SERIAL_UART_FIRST_INDEX == 0), SERIAL_PORT_USART1 (51 or 50), SERIAL_PORT_USART2, SERIAL_PORT_USART3, SERIAL_PORT_UART4, SERIAL_PORT_UART5, SERIAL_PORT_USART6, SERIAL_PORT_USART7, SERIAL_PORT_USART8, SERIAL_PORT_UART9, SERIAL_PORT_USART10. While some aliases exist (like SERIAL_PORT_UART3 = SERIAL_PORT_USART3), prefer using the primary identifiers as referenced in the serialPortIdentifiers array to avoid build failures.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-08-20T02:54:58.596Z
Learnt from: ot0tot
PR: betaflight/config#872
File: configs/HGLRCH743/config.h:82-83
Timestamp: 2025-08-20T02:54:58.596Z
Learning: For Betaflight board configuration reviews, the definitive source for validating UART pin assignments is the serial_uart_{platform}.c file in the Betaflight codebase (e.g., serial_uart_stm32h7xx.c for STM32H7xx platforms), not generic MCU datasheets. These files contain the exact pin mappings that Betaflight supports for each UART peripheral.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-08-28T20:45:36.652Z
Learnt from: haslinghuis
PR: betaflight/config#888
File: configs/ZEX_ATHENA_MINI/config.h:0-0
Timestamp: 2025-08-28T20:45:36.652Z
Learning: In STM32H743 Betaflight configurations, PA15 maps to TIM2_CH1 (timer index 2) as defined in timer_stm32h7xx.c. When used for GYRO_CLKIN functionality, it's recommended to use the macro name GYRO_1_CLKIN_PIN in TIMER_PIN_MAPPING for consistency with other pin definitions.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-07-28T16:44:59.686Z
Learnt from: haslinghuis
PR: betaflight/config#656
File: configs/IFLIGHT_F745_AIO/config.h:31-35
Timestamp: 2025-07-28T16:44:59.686Z
Learning: In Betaflight board configurations, when a board design uses the same physical gyro socket but different sensor variants across production batches (e.g., MPU6000 in older batches, ICM42688P in newer batches), the correct approach is to enable both sensor drivers (USE_GYRO_SPI_MPU6000 and USE_GYRO_SPI_ICM42688P) in the same configuration. This allows runtime auto-detection of which sensor is actually present without requiring separate board configurations for each hardware variant.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-06-08T22:02:28.961Z
Learnt from: haslinghuis
PR: betaflight/config#814
File: configs/JHEF405PRO/config.h:109-109
Timestamp: 2025-06-08T22:02:28.961Z
Learning: The JHEF405PRO board does not actually use dual gyros despite having GYRO_2_SPI_INSTANCE defined in its configuration. It should not receive GYRO_COUNT or other dual-gyro related definitions since only the first gyro is supported.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-05-28T15:45:15.608Z
Learnt from: haslinghuis
PR: betaflight/config#792
File: configs/MERAKRCF722/config.h:32-32
Timestamp: 2025-05-28T15:45:15.608Z
Learning: The presence of GYRO_2_SPI_INSTANCE definition in a board config does not necessarily mean the board uses dual gyros. Some boards have GYRO_2_SPI_INSTANCE defined but it's not actually used, so they should not receive GYRO_COUNT or other dual-gyro related definitions. Only boards that actually utilize dual gyros should get these definitions.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-07-03T15:17:30.040Z
Learnt from: haslinghuis
PR: betaflight/config#0
File: :0-0
Timestamp: 2025-07-03T15:17:30.040Z
Learning: In Betaflight configurations, when a target name suggests dual IMUs (like JHEF7DUAL) but specific hardware variants only have one gyro available, the preferred solution is to use DEFAULT_GYRO_TO_USE macro to specify which gyro to use by default rather than pruning gyro defines or creating redundant configurations. This approach maintains compatibility when the same target is used by multiple hardware variants from the same manufacturer.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-07-25T20:06:07.492Z
Learnt from: haslinghuis
PR: betaflight/config#719
File: configs/SPEDIXG473/config.h:29-38
Timestamp: 2025-07-25T20:06:07.492Z
Learning: BMP280 and DPS310 barometer drivers in Betaflight do not require USE_I2C to be explicitly defined in board configurations. Many existing boards successfully use USE_BARO_BMP280 and USE_BARO_DPS310 without defining USE_I2C, indicating that the I2C dependency is handled automatically by the build system or these sensors support alternative communication methods.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-07-25T20:06:07.492Z
Learnt from: haslinghuis
PR: betaflight/config#719
File: configs/SPEDIXG473/config.h:29-38
Timestamp: 2025-07-25T20:06:07.492Z
Learning: BMP280 and DPS310 barometer drivers in Betaflight do not require USE_I2C to be explicitly defined in board configurations. Out of 264 boards using these drivers, 259 (98%) work without USE_I2C defined, indicating that the I2C dependency is handled automatically by the build system.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-05-28T15:48:18.449Z
Learnt from: haslinghuis
PR: betaflight/config#792
File: configs/FLYWOOF411/config.h:33-33
Timestamp: 2025-05-28T15:48:18.449Z
Learning: The FLYWOOF411 board does not actually use dual gyros despite having GYRO_2_SPI_INSTANCE defined in its configuration. It was incorrectly targeted for GYRO_COUNT and dual gyro support.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-06-02T16:16:20.197Z
Learnt from: haslinghuis
PR: betaflight/config#0
File: :0-0
Timestamp: 2025-06-02T16:16:20.197Z
Learning: In STM32F405-based flight controller configurations, timer pin mappings must be carefully analyzed for DMA stream conflicts, especially between motor timers, LED strip timers, and SPI DMA assignments. Changes to TIMER_PIN_MAPPING should include verification that all required peripherals (motors, LED strip, blackbox SPI) can coexist without DMA conflicts.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-05-31T17:01:39.423Z
Learnt from: haslinghuis
PR: betaflight/config#798
File: configs/FURYF4OSD/config.h:88-88
Timestamp: 2025-05-31T17:01:39.423Z
Learning: For STM32F4xx platforms, PB1 pin timer definitions are:
1 = DEF_TIM(TIM1, CH3N, PB1, 0, 0)
2 = DEF_TIM(TIM3, CH4, PB1, 0, 0) 
3 = DEF_TIM(TIM8, CH3N, PB1, 0, 0)
Timer instance 2 (TIM3, CH4) is the correct mapping for PB1 motor control on STM32F4xx platforms as defined in src/platform/STM32/timer_stm32f4xx.c

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-07-14T15:41:14.364Z
Learnt from: ot0tot
PR: betaflight/config#834
File: configs/RADIOLINKF405/config.h:79-88
Timestamp: 2025-07-14T15:41:14.364Z
Learning: In STM32F405 configurations, PB1 typically maps to TIM3_CH4 and PC9 typically maps to TIM8_CH4. These are different timers and do not share DMA resources, so there is no conflict when both pins are used simultaneously (e.g., PB1 for LED_STRIP and PC9 for MOTOR4).

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-08-28T20:45:36.652Z
Learnt from: haslinghuis
PR: betaflight/config#888
File: configs/ZEX_ATHENA_MINI/config.h:0-0
Timestamp: 2025-08-28T20:45:36.652Z
Learning: In STM32H743 Betaflight configurations, PB0 can use multiple timer options including TIM1_CH2N, TIM3_CH3, and TIM8_CH2N as defined in timer_stm32h7xx.c. For CAMERA_CONTROL_PIN assignments, TIM3_CH3 (timer index 3) is the appropriate choice.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-06-02T16:16:20.197Z
Learnt from: haslinghuis
PR: betaflight/config#0
File: :0-0
Timestamp: 2025-06-02T16:16:20.197Z
Learning: For Betaflight configurations, blackbox logging via SPI3 and LED_STRIP functionality can be mutually exclusive due to DMA stream conflicts on STM32F4 targets. This hardware limitation should be identified during timer configuration reviews.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-07-14T15:38:58.935Z
Learnt from: ot0tot
PR: betaflight/config#834
File: configs/RADIOLINKF405/config.h:54-54
Timestamp: 2025-07-14T15:38:58.935Z
Learning: ESC sensor communication in Betaflight is unidirectional and only requires the UART RX pin. It does not need bidirectional communication, so UART_TX_PIN definitions are not required for ESC sensor UARTs. Some flight controller boards may not even expose the TX pin for the UART designated for ESC sensor use.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-08-21T11:11:19.213Z
Learnt from: haslinghuis
PR: betaflight/config#870
File: configs/ZEX_ATHENA_STD_PRO/config.h:54-55
Timestamp: 2025-08-21T11:11:19.213Z
Learning: For STM32H743 in Betaflight, UART4 can use PB8 (UART4_RX) and PB9 (UART4_TX) as confirmed in the official Betaflight codebase at src/platform/STM32/serial_uart_stm32h7xx.c. This contradicts some generic STM32 documentation that might not show all supported pin configurations used by Betaflight.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-08-21T11:11:19.213Z
Learnt from: haslinghuis
PR: betaflight/config#870
File: configs/ZEX_ATHENA_STD_PRO/config.h:54-55
Timestamp: 2025-08-21T11:11:19.213Z
Learning: For STM32H743 in Betaflight, UART4 can use PB8 (UART4_RX) and PB9 (UART4_TX) with GPIO_AF8_UART4, as confirmed in the official Betaflight codebase at src/platform/STM32/serial_uart_stm32h7xx.c. This is a valid pin mapping despite what some generic STM32 documentation might suggest.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-07-14T15:38:06.837Z
Learnt from: ot0tot
PR: betaflight/config#834
File: configs/RADIOLINKF405/config.h:52-53
Timestamp: 2025-07-14T15:38:06.837Z
Learning: In Betaflight flight controller configurations, it's common and intentional for UART2_RX_PIN and RX_PPM_PIN to share the same GPIO pin (like PA3) because they represent mutually exclusive receiver input protocols. The pin can be configured for either serial receiver input (UART2) or PPM input, but not both simultaneously. This is a standard design pattern in flight controller hardware.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-08-26T14:26:11.863Z
Learnt from: haslinghuis
PR: betaflight/config#883
File: configs/HGLRCF435_AIO/config.h:50-58
Timestamp: 2025-08-26T14:26:11.863Z
Learning: For AT32F435 in Betaflight, UART4 supports multiple pin options including PH2 (UART4_RX) and PH3 (UART4_TX) with GPIO_MUX_8, as confirmed in the official Betaflight codebase at src/platform/AT32/serial_uart_at32f43x.c. The AT32 platform has broader pin support than initially apparent from basic searches.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-09-01T19:58:52.049Z
Learnt from: haslinghuis
PR: betaflight/config#881
File: configs/GEPRC_TAKER_H743MINI/config.h:86-99
Timestamp: 2025-09-01T19:58:52.049Z
Learning: For STM32H743 PB0 in Betaflight, there are three timer options: TIM1_CH2N, TIM3_CH3, and TIM8_CH2N. Only TIM3_CH3 (timer index 2) is suitable for GYRO_CLKIN as the other two are complementary (N) channels. This is confirmed in timer_stm32h7xx.c.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-09-01T19:58:52.049Z
Learnt from: haslinghuis
PR: betaflight/config#881
File: configs/GEPRC_TAKER_H743MINI/config.h:86-99
Timestamp: 2025-09-01T19:58:52.049Z
Learning: For STM32H743 in Betaflight, PB0 has multiple timer options but only timer index 2 provides a non-complementary output suitable for GYRO_CLKIN functionality. The other timer options for PB0 are N channels (complementary outputs) which are not appropriate for CLKIN usage.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-08-10T14:08:56.662Z
Learnt from: blckmn
PR: betaflight/config#851
File: configs/HELLBENDER_0001/config.h:45-46
Timestamp: 2025-08-10T14:08:56.662Z
Learning: In Betaflight, USE_LED_STRIP is a cloud build option that enables/disables the LED strip feature at build time. Individual target config files (configs/*/config.h) only need to define LED_STRIP_PIN as a default pin assignment - they should not define USE_LED_STRIP themselves. The feature enablement is handled externally through the cloud build system, not through preprocessor directives in the config files.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-07-08T22:26:29.906Z
Learnt from: haslinghuis
PR: betaflight/config#829
File: configs/HELLBENDER_0001/config.h:53-56
Timestamp: 2025-07-08T22:26:29.906Z
Learning: In Betaflight configurations, SDCARD_CS_PIN and FLASH_CS_PIN can share the same GPIO pin because Betaflight uses either flash or sdcard storage, not both simultaneously. This is a mutually exclusive design where only one storage method is active at a time, so shared CS pin assignments are intentional and do not cause conflicts.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-07-14T16:16:50.628Z
Learnt from: haslinghuis
PR: betaflight/config#835
File: configs/HDZERO_HALO_MPU6000/config.h:29-35
Timestamp: 2025-07-14T16:16:50.628Z
Learning: GYRO_1_SPI_CLOCK_DIVIDER is not used in any Betaflight target configuration files. SPI clock frequency settings are not commonly configured at the target level.

Applied to files:

  • configs/HWH7/config.h
🔇 Additional comments (17)
configs/HWH7/config.h (17)

24-26: BOARD_NAME/manufacturer/MCU IDs: OK

BOARD_NAME matches directory (HWH7), MCU and manufacturer look correct.


28-34: Sensor selection limited to ICM42688P: good call

MPU6000 removed; aligns with schematic/orientation concerns. Keeping both ACC/GYRO ICM42688P is correct.


35-40: Baro/mag I2C instance: OK

DPS310 on I2C2 and MAG_I2C_INSTANCE preset without USE_MAG is consistent with Betaflight patterns.


41-49: LED_STRIP on TIM2 and BEEPER on TIM5: correct conflict resolution

This separation avoids the shared‑timer frequency clash. Mapping indices (LED_STRIP opt 1, BEEPER opt 2) look right.

Also applies to: 151-167


50-58: Motor outputs on TIM1/TIM4: looks consistent

PE9/11/13/14 on TIM1 and PD12‑15 on TIM4 are a common H743 layout.


60-63: Servos on TIM15: OK

PE5/PE6 (TIM15 CH1/CH2) are valid servo channels.


64-67: I2C2 pins: OK

PB10/PB11 for I2C2 is standard and leaves PB8/PB9 free.


121-135: SDMMC 4‑bit Blackbox defaults: OK

Pins and default device set to SDCARD look correct.


136-146: ADC pins and meter defaults: OK

VBAT/CURR/EXT pins + scale=117, offset=0 are reasonable; voltage scale not redundantly defined.


147-150: SWD pads defines: acceptable

These are informational for pad availability; fine to keep.


151-160: Timer map for motors: DMA assignments look sane

DMA index progression 1..7 with MOTOR8 -1 is typical for avoiding conflicts.


176-189: PINIO defaults: OK

Naming (“CAM 1,2”, “SW_VTX”) and configs look reasonable.


190-199: Default serial roles: minor concern with SERIALRX on USART1

Using USART1 for RX can confuse users when powering via USB (DFU hijack risk). Consider mapping CRSF to another UART by default, or omit the default and let users assign.

-#define SERIALRX_PROVIDER        SERIALRX_CRSF
-#define SERIALRX_UART            SERIAL_PORT_USART1
+/* Consider leaving SERIALRX unset by default to avoid DFU/USB confusion on USART1 */
+/* #define SERIALRX_PROVIDER     SERIALRX_CRSF */
+/* #define SERIALRX_UART         SERIAL_PORT_USART1 */

113-120: MAX7456 on SPI3: verify PD6 mapping

Automated check failed (git clone error). Confirm PD6 is configured as SPI3_SDO (MOSI) for H743 in betaflight/src/platform/STM32/spi_stm32h7xx.c — e.g. run:
rg -n -C2 'PD6' betaflight/src/platform/STM32/spi_stm32h7xx.c


170-175: DMA opts: TIMUP1/4 and ADC1/3 OK — explicit SPIx DMA opts still present; confirm scope

TIMUP1/4 and ADC1/3 in configs/HWH7/config.h look fine.
rg output shows many other configs still define SPIx_*_DMA_OPT, so the claim that explicit SPIx opts were removed repo-wide is incorrect — confirm whether SPI DMA opts should be removed globally (update remaining configs) or this change is intentionally local to HWH7.

Likely an incorrect or invalid review comment.


75-94: Dual gyro SPI mappings: OK; EXTI on PC14/PC15—verify LSE use

SPI1/2 pins and CS lines look valid. Using PC14/PC15 for EXTI is fine if LSE isn’t needed; confirm board doesn’t require LSE.


68-74: CLKIN on PB8/PB9 (TIM16/TIM17): confirmed

timer_stm32h7xx.c contains DEF_TIM(TIM16, CH1, PB8) and DEF_TIM(TIM17, CH1, PB9) — TIM16/TIM17 CH1 present and suitable for CLKIN (src/platform/STM32/timer_stm32h7xx.c, lines 89–90).

@Arwayday Arwayday closed this Sep 21, 2025
@Arwayday Arwayday reopened this Sep 21, 2025
@Arwayday Arwayday requested a review from ot0tot September 21, 2025 23:00
Delete useless macros.

Co-authored-by: ot0tot <[email protected]>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
configs/HWH7/config.h (1)

189-197: Missing default SERIALRX UART mapping (if CRSF on USART1 is intended).

PR summary mentions CRSF on USART1 by default, but SERIALRX_UART isn’t defined here. Add it if you still want that default; otherwise, leave it unset to avoid DFU‑mode confusion on UART1.

 #define SERIALRX_PROVIDER        SERIALRX_CRSF
+#define SERIALRX_UART            SERIAL_PORT_USART1
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b66b067 and eca1d39.

📒 Files selected for processing (1)
  • configs/HWH7/config.h (1 hunks)
🧰 Additional context used
🧠 Learnings (33)
📓 Common learnings
Learnt from: haslinghuis
PR: betaflight/config#888
File: configs/ZEX_ATHENA_MINI/config.h:0-0
Timestamp: 2025-08-28T20:45:36.652Z
Learning: In STM32H743 Betaflight configurations, PA15 maps to TIM2_CH1 (timer index 2) as defined in timer_stm32h7xx.c. When used for GYRO_CLKIN functionality, it's recommended to use the macro name GYRO_1_CLKIN_PIN in TIMER_PIN_MAPPING for consistency with other pin definitions.
Learnt from: haslinghuis
PR: betaflight/config#835
File: configs/HDZERO_HALO_MPU6000/config.h:44-56
Timestamp: 2025-07-14T16:16:56.822Z
Learning: For Betaflight board configurations of boards already in production, pin assignments in config.h files reflect the actual hardware design and cannot be changed, even if they present potential conflicts with debug interfaces. The configuration must match the physical board layout, not ideal software design preferences.
📚 Learning: 2025-07-14T16:16:56.822Z
Learnt from: haslinghuis
PR: betaflight/config#835
File: configs/HDZERO_HALO_MPU6000/config.h:44-56
Timestamp: 2025-07-14T16:16:56.822Z
Learning: For Betaflight board configurations of boards already in production, pin assignments in config.h files reflect the actual hardware design and cannot be changed, even if they present potential conflicts with debug interfaces. The configuration must match the physical board layout, not ideal software design preferences.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-07-03T04:33:57.480Z
Learnt from: ot0tot
PR: betaflight/config#0
File: :0-0
Timestamp: 2025-07-03T04:33:57.480Z
Learning: Always verify that the BOARD_NAME define in each config.h matches the directory name it resides in (e.g., configs/AXISFLYINGF7AIO/config.h must have #define BOARD_NAME AXISFLYINGF7AIO). This check is required for all Betaflight board configuration reviews.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-08-22T17:08:23.283Z
Learnt from: haslinghuis
PR: betaflight/config#879
File: configs/AIRBOTSUPERF4V2/config.h:42-45
Timestamp: 2025-08-22T17:08:23.283Z
Learning: In Betaflight board configurations, OSD feature flags like USE_OSD_SD (analog/MAX7456) and USE_OSD_HD (digital/MSP DisplayPort) are typically defined at build time by the build system, not in the individual board config.h files. Board configs can conditionally define OSD-related settings based on these build-time flags.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-07-23T13:43:50.456Z
Learnt from: ot0tot
PR: betaflight/config#0
File: :0-0
Timestamp: 2025-07-23T13:43:50.456Z
Learning: For Betaflight board configuration reviews, always verify that serial port defines (like ESC_SENSOR_UART, MSP_UART, GPS_UART, etc.) use valid SERIAL_PORT identifiers that match those defined in the Betaflight codebase at src/main/io/serial.h. Common valid identifiers include SERIAL_PORT_USART1, SERIAL_PORT_USART2, SERIAL_PORT_USART3, SERIAL_PORT_UART4, SERIAL_PORT_UART5, etc. Invalid identifiers like SERIAL_PORT_UART3 (should be SERIAL_PORT_USART3) will cause build failures.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-06-23T18:43:31.746Z
Learnt from: haslinghuis
PR: betaflight/config#822
File: configs/AXISFLYINGH7MINI/config.h:29-37
Timestamp: 2025-06-23T18:43:31.746Z
Learning: In Betaflight configuration files, feature enablement macros like USE_MAG are build options that can be controlled at compile time, while hardware instance definitions like MAG_I2C_INSTANCE are predefined in board configurations to assist with hardware mapping when those features are enabled at build time.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-07-03T04:33:57.480Z
Learnt from: ot0tot
PR: betaflight/config#0
File: :0-0
Timestamp: 2025-07-03T04:33:57.480Z
Learning: Always verify that the `BOARD_NAME` define in config.h files exactly matches the directory name where the config file is located. For example, if the config file is in configs/AXISFLYINGF7AIO/config.h, then the BOARD_NAME should be defined as "AXISFLYINGF7AIO". This ensures proper board identification and configuration loading in Betaflight.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-08-20T02:54:58.596Z
Learnt from: ot0tot
PR: betaflight/config#872
File: configs/HGLRCH743/config.h:82-83
Timestamp: 2025-08-20T02:54:58.596Z
Learning: For Betaflight board configuration reviews, the definitive source for validating UART pin assignments is the serial_uart_{platform}.c file in the Betaflight codebase (e.g., serial_uart_stm32h7xx.c for STM32H7xx platforms), not generic MCU datasheets. These files contain the exact pin mappings that Betaflight supports for each UART peripheral.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-07-23T13:43:50.456Z
Learnt from: ot0tot
PR: betaflight/config#0
File: :0-0
Timestamp: 2025-07-23T13:43:50.456Z
Learning: For Betaflight board configuration reviews, always verify that serial port defines use valid identifiers from the serialPortIdentifier_e enum in src/main/io/serial.h. Valid identifiers include: SERIAL_PORT_USB_VCP (20), SERIAL_PORT_SOFTSERIAL1 (30), SERIAL_PORT_SOFTSERIAL2 (31), SERIAL_PORT_LPUART1 (40), SERIAL_PORT_UART0 (50, if SERIAL_UART_FIRST_INDEX == 0), SERIAL_PORT_USART1 (51 or 50), SERIAL_PORT_USART2, SERIAL_PORT_USART3, SERIAL_PORT_UART4, SERIAL_PORT_UART5, SERIAL_PORT_USART6, SERIAL_PORT_USART7, SERIAL_PORT_USART8, SERIAL_PORT_UART9, SERIAL_PORT_USART10. While some aliases exist (like SERIAL_PORT_UART3 = SERIAL_PORT_USART3), prefer using the primary identifiers as referenced in the serialPortIdentifiers array to avoid build failures.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-06-23T18:44:59.162Z
Learnt from: haslinghuis
PR: betaflight/config#822
File: configs/AXISFLYINGH7MINI/config.h:121-129
Timestamp: 2025-06-23T18:44:59.162Z
Learning: In Betaflight configuration files, USE_OSD_HD and USE_MAX7456 are for different OSD systems: USE_MAX7456 enables the MAX7456 analog OSD chip, while USE_OSD_HD enables HD/digital OSD via MSP. MSP_DISPLAYPORT_UART should be guarded by USE_OSD_HD, not USE_MAX7456, as they serve different OSD implementations.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-08-28T20:45:36.652Z
Learnt from: haslinghuis
PR: betaflight/config#888
File: configs/ZEX_ATHENA_MINI/config.h:0-0
Timestamp: 2025-08-28T20:45:36.652Z
Learning: In STM32H743 Betaflight configurations, PA15 maps to TIM2_CH1 (timer index 2) as defined in timer_stm32h7xx.c. When used for GYRO_CLKIN functionality, it's recommended to use the macro name GYRO_1_CLKIN_PIN in TIMER_PIN_MAPPING for consistency with other pin definitions.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-07-28T16:44:59.686Z
Learnt from: haslinghuis
PR: betaflight/config#656
File: configs/IFLIGHT_F745_AIO/config.h:31-35
Timestamp: 2025-07-28T16:44:59.686Z
Learning: In Betaflight board configurations, when a board design uses the same physical gyro socket but different sensor variants across production batches (e.g., MPU6000 in older batches, ICM42688P in newer batches), the correct approach is to enable both sensor drivers (USE_GYRO_SPI_MPU6000 and USE_GYRO_SPI_ICM42688P) in the same configuration. This allows runtime auto-detection of which sensor is actually present without requiring separate board configurations for each hardware variant.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-06-08T22:02:28.961Z
Learnt from: haslinghuis
PR: betaflight/config#814
File: configs/JHEF405PRO/config.h:109-109
Timestamp: 2025-06-08T22:02:28.961Z
Learning: The JHEF405PRO board does not actually use dual gyros despite having GYRO_2_SPI_INSTANCE defined in its configuration. It should not receive GYRO_COUNT or other dual-gyro related definitions since only the first gyro is supported.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-05-28T15:45:15.608Z
Learnt from: haslinghuis
PR: betaflight/config#792
File: configs/MERAKRCF722/config.h:32-32
Timestamp: 2025-05-28T15:45:15.608Z
Learning: The presence of GYRO_2_SPI_INSTANCE definition in a board config does not necessarily mean the board uses dual gyros. Some boards have GYRO_2_SPI_INSTANCE defined but it's not actually used, so they should not receive GYRO_COUNT or other dual-gyro related definitions. Only boards that actually utilize dual gyros should get these definitions.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-07-03T15:17:30.040Z
Learnt from: haslinghuis
PR: betaflight/config#0
File: :0-0
Timestamp: 2025-07-03T15:17:30.040Z
Learning: In Betaflight configurations, when a target name suggests dual IMUs (like JHEF7DUAL) but specific hardware variants only have one gyro available, the preferred solution is to use DEFAULT_GYRO_TO_USE macro to specify which gyro to use by default rather than pruning gyro defines or creating redundant configurations. This approach maintains compatibility when the same target is used by multiple hardware variants from the same manufacturer.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-07-25T20:06:07.492Z
Learnt from: haslinghuis
PR: betaflight/config#719
File: configs/SPEDIXG473/config.h:29-38
Timestamp: 2025-07-25T20:06:07.492Z
Learning: BMP280 and DPS310 barometer drivers in Betaflight do not require USE_I2C to be explicitly defined in board configurations. Many existing boards successfully use USE_BARO_BMP280 and USE_BARO_DPS310 without defining USE_I2C, indicating that the I2C dependency is handled automatically by the build system or these sensors support alternative communication methods.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-07-25T20:06:07.492Z
Learnt from: haslinghuis
PR: betaflight/config#719
File: configs/SPEDIXG473/config.h:29-38
Timestamp: 2025-07-25T20:06:07.492Z
Learning: BMP280 and DPS310 barometer drivers in Betaflight do not require USE_I2C to be explicitly defined in board configurations. Out of 264 boards using these drivers, 259 (98%) work without USE_I2C defined, indicating that the I2C dependency is handled automatically by the build system.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-05-28T15:48:18.449Z
Learnt from: haslinghuis
PR: betaflight/config#792
File: configs/FLYWOOF411/config.h:33-33
Timestamp: 2025-05-28T15:48:18.449Z
Learning: The FLYWOOF411 board does not actually use dual gyros despite having GYRO_2_SPI_INSTANCE defined in its configuration. It was incorrectly targeted for GYRO_COUNT and dual gyro support.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-06-02T16:16:20.197Z
Learnt from: haslinghuis
PR: betaflight/config#0
File: :0-0
Timestamp: 2025-06-02T16:16:20.197Z
Learning: In STM32F405-based flight controller configurations, timer pin mappings must be carefully analyzed for DMA stream conflicts, especially between motor timers, LED strip timers, and SPI DMA assignments. Changes to TIMER_PIN_MAPPING should include verification that all required peripherals (motors, LED strip, blackbox SPI) can coexist without DMA conflicts.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-05-31T17:01:39.423Z
Learnt from: haslinghuis
PR: betaflight/config#798
File: configs/FURYF4OSD/config.h:88-88
Timestamp: 2025-05-31T17:01:39.423Z
Learning: For STM32F4xx platforms, PB1 pin timer definitions are:
1 = DEF_TIM(TIM1, CH3N, PB1, 0, 0)
2 = DEF_TIM(TIM3, CH4, PB1, 0, 0) 
3 = DEF_TIM(TIM8, CH3N, PB1, 0, 0)
Timer instance 2 (TIM3, CH4) is the correct mapping for PB1 motor control on STM32F4xx platforms as defined in src/platform/STM32/timer_stm32f4xx.c

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-07-14T15:41:14.364Z
Learnt from: ot0tot
PR: betaflight/config#834
File: configs/RADIOLINKF405/config.h:79-88
Timestamp: 2025-07-14T15:41:14.364Z
Learning: In STM32F405 configurations, PB1 typically maps to TIM3_CH4 and PC9 typically maps to TIM8_CH4. These are different timers and do not share DMA resources, so there is no conflict when both pins are used simultaneously (e.g., PB1 for LED_STRIP and PC9 for MOTOR4).

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-08-28T20:45:36.652Z
Learnt from: haslinghuis
PR: betaflight/config#888
File: configs/ZEX_ATHENA_MINI/config.h:0-0
Timestamp: 2025-08-28T20:45:36.652Z
Learning: In STM32H743 Betaflight configurations, PB0 can use multiple timer options including TIM1_CH2N, TIM3_CH3, and TIM8_CH2N as defined in timer_stm32h7xx.c. For CAMERA_CONTROL_PIN assignments, TIM3_CH3 (timer index 3) is the appropriate choice.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-06-02T16:16:20.197Z
Learnt from: haslinghuis
PR: betaflight/config#0
File: :0-0
Timestamp: 2025-06-02T16:16:20.197Z
Learning: For Betaflight configurations, blackbox logging via SPI3 and LED_STRIP functionality can be mutually exclusive due to DMA stream conflicts on STM32F4 targets. This hardware limitation should be identified during timer configuration reviews.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-07-14T15:38:58.935Z
Learnt from: ot0tot
PR: betaflight/config#834
File: configs/RADIOLINKF405/config.h:54-54
Timestamp: 2025-07-14T15:38:58.935Z
Learning: ESC sensor communication in Betaflight is unidirectional and only requires the UART RX pin. It does not need bidirectional communication, so UART_TX_PIN definitions are not required for ESC sensor UARTs. Some flight controller boards may not even expose the TX pin for the UART designated for ESC sensor use.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-08-21T11:11:19.213Z
Learnt from: haslinghuis
PR: betaflight/config#870
File: configs/ZEX_ATHENA_STD_PRO/config.h:54-55
Timestamp: 2025-08-21T11:11:19.213Z
Learning: For STM32H743 in Betaflight, UART4 can use PB8 (UART4_RX) and PB9 (UART4_TX) as confirmed in the official Betaflight codebase at src/platform/STM32/serial_uart_stm32h7xx.c. This contradicts some generic STM32 documentation that might not show all supported pin configurations used by Betaflight.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-08-21T11:11:19.213Z
Learnt from: haslinghuis
PR: betaflight/config#870
File: configs/ZEX_ATHENA_STD_PRO/config.h:54-55
Timestamp: 2025-08-21T11:11:19.213Z
Learning: For STM32H743 in Betaflight, UART4 can use PB8 (UART4_RX) and PB9 (UART4_TX) with GPIO_AF8_UART4, as confirmed in the official Betaflight codebase at src/platform/STM32/serial_uart_stm32h7xx.c. This is a valid pin mapping despite what some generic STM32 documentation might suggest.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-07-14T15:38:06.837Z
Learnt from: ot0tot
PR: betaflight/config#834
File: configs/RADIOLINKF405/config.h:52-53
Timestamp: 2025-07-14T15:38:06.837Z
Learning: In Betaflight flight controller configurations, it's common and intentional for UART2_RX_PIN and RX_PPM_PIN to share the same GPIO pin (like PA3) because they represent mutually exclusive receiver input protocols. The pin can be configured for either serial receiver input (UART2) or PPM input, but not both simultaneously. This is a standard design pattern in flight controller hardware.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-08-26T14:26:11.863Z
Learnt from: haslinghuis
PR: betaflight/config#883
File: configs/HGLRCF435_AIO/config.h:50-58
Timestamp: 2025-08-26T14:26:11.863Z
Learning: For AT32F435 in Betaflight, UART4 supports multiple pin options including PH2 (UART4_RX) and PH3 (UART4_TX) with GPIO_MUX_8, as confirmed in the official Betaflight codebase at src/platform/AT32/serial_uart_at32f43x.c. The AT32 platform has broader pin support than initially apparent from basic searches.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-09-01T19:58:52.049Z
Learnt from: haslinghuis
PR: betaflight/config#881
File: configs/GEPRC_TAKER_H743MINI/config.h:86-99
Timestamp: 2025-09-01T19:58:52.049Z
Learning: For STM32H743 PB0 in Betaflight, there are three timer options: TIM1_CH2N, TIM3_CH3, and TIM8_CH2N. Only TIM3_CH3 (timer index 2) is suitable for GYRO_CLKIN as the other two are complementary (N) channels. This is confirmed in timer_stm32h7xx.c.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-09-01T19:58:52.049Z
Learnt from: haslinghuis
PR: betaflight/config#881
File: configs/GEPRC_TAKER_H743MINI/config.h:86-99
Timestamp: 2025-09-01T19:58:52.049Z
Learning: For STM32H743 in Betaflight, PB0 has multiple timer options but only timer index 2 provides a non-complementary output suitable for GYRO_CLKIN functionality. The other timer options for PB0 are N channels (complementary outputs) which are not appropriate for CLKIN usage.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-08-10T14:08:56.662Z
Learnt from: blckmn
PR: betaflight/config#851
File: configs/HELLBENDER_0001/config.h:45-46
Timestamp: 2025-08-10T14:08:56.662Z
Learning: In Betaflight, USE_LED_STRIP is a cloud build option that enables/disables the LED strip feature at build time. Individual target config files (configs/*/config.h) only need to define LED_STRIP_PIN as a default pin assignment - they should not define USE_LED_STRIP themselves. The feature enablement is handled externally through the cloud build system, not through preprocessor directives in the config files.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-07-08T22:26:29.906Z
Learnt from: haslinghuis
PR: betaflight/config#829
File: configs/HELLBENDER_0001/config.h:53-56
Timestamp: 2025-07-08T22:26:29.906Z
Learning: In Betaflight configurations, SDCARD_CS_PIN and FLASH_CS_PIN can share the same GPIO pin because Betaflight uses either flash or sdcard storage, not both simultaneously. This is a mutually exclusive design where only one storage method is active at a time, so shared CS pin assignments are intentional and do not cause conflicts.

Applied to files:

  • configs/HWH7/config.h
📚 Learning: 2025-07-14T16:16:50.628Z
Learnt from: haslinghuis
PR: betaflight/config#835
File: configs/HDZERO_HALO_MPU6000/config.h:29-35
Timestamp: 2025-07-14T16:16:50.628Z
Learning: GYRO_1_SPI_CLOCK_DIVIDER is not used in any Betaflight target configuration files. SPI clock frequency settings are not commonly configured at the target level.

Applied to files:

  • configs/HWH7/config.h
🔇 Additional comments (6)
configs/HWH7/config.h (6)

24-26: Board identifiers look correct.

FC_TARGET_MCU, BOARD_NAME (HWH7), and MANUFACTURER_ID align with the directory and target.


113-120: MAX7456/SPI3 wiring looks plausible.

Assuming SPI3_MOSI on PD6 is supported on H7, this is fine. If issues appear, confirm PD6 AF for SPI3_MOSI in Betaflight’s SPI pin table.


169-174: DMA option defines: unique in HWH7; DMAMUX mapping must still be checked.

rg shows only TIMUP1_DMA_OPT=8, TIMUP4_DMA_OPT=9, ADC1_DMA_OPT=11, ADC3_DMA_OPT=12 in configs/HWH7/config.h (lines 170–173) and no SPI_*_DMA_OPT in that file — values are unique within this board config. Verify these numeric indices against the STM32H7 DMAMUX request table / HAL to ensure they map to the intended peripherals and don't conflict with other on-board DMA users.


42-49: Confirm LED_STRIP on TIM2 and BEEPER on TIM5 are actually selected by the option indexes.

PA0/PA1 support both TIM2 and TIM5. With option index 1 for LED_STRIP and 2 for BEEPER, this should resolve the prior conflict (LED on TIM2_CH1, beeper on TIM5_CH2). Please verify the timer option ordering in timer_stm32h7xx.c to ensure the intended timers are chosen at runtime, and that BEEPER_INVERTED is correct for your hardware.

Run:

Also applies to: 150-166


69-74: Verify TIM16/TIM17 (PB8/PB9) as GYRO_CLKIN

HWH7 sets GYRO_1_CLKIN_PIN = PB8 and GYRO_2_CLKIN_PIN = PB9 (configs/HWH7/config.h:69-71). Repo comments/TIMER_PIN_MAPs reference TIM16/TIM17 on PB8/PB9 (e.g. configs/SPRACINGH7EF/config.h:316-317), but I could not locate timer_stm32h7xx.c to confirm the platform timer mapping or whether TIM16_CH1/TIM17_CH1 can be used as external CLKIN with the correct polarity/frequency for the ICM‑42688P. Verify timer_stm32h7xx.c (or the STM32 H7 timer mapping) supports TIM16_CH1→PB8 and TIM17_CH1→PB9 for CLKIN and that the ICM‑42688P clock settings (freq/polarity) are correct.


95-104: UART4 PD0/PD1 mapping is valid — keep as-is.

Multiple STM32H7 board configs in this repo set UART4_TX = PD1 and UART4_RX = PD0 (e.g. KAKUTEH7, MAMBAH743, TMH7, SPRACINGH7ZERO, FLYCOLORH743); PB8/PB9 is an alternative on some boards (e.g. IFLIGHT_BLITZ_H7_PRO). No change required unless this board needs PD0/PD1 for another function — then pick a supported alternative (PB8/PB9 or PA0/PA1) and adjust GYRO_CLKIN/timer wiring accordingly.

@Arwayday Arwayday requested a review from ot0tot September 23, 2025 02:19
@Arwayday Arwayday changed the title Add XROTOR-H7 (STM32H743) config – initial Add HWH7 (STM32H743) config – initial Sep 23, 2025
@sugaarK sugaarK merged commit 987e5dc into betaflight:master Sep 23, 2025
2 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Sep 23, 2025
6 tasks
This was referenced Nov 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants